#include <Servo.h> 
Servo servo1; 
Servo servo2;         
int pos1 = 90; 

void setup()
{
  servo1.attach(5);
  servo2.attach(6);
  servo1.write(90);
  servo2.write(90);
  Serial.begin(9600);
  Serial.println("Starting");
} 
 
void loop()
{ 
  Serial.println("for 1");
  for(pos1 = 90; pos1 < 130; pos1 += 10)
  {
    //servo1.write(pos1);
    servo2.write(pos1);
    Serial.println(pos1);
    delay(1000); 
  }
   Serial.println("for 2");
  for(pos1 = 130; pos1>90; pos1-=10) 
  {
    //servo1.write(pos1);
    servo2.write(pos1);
    Serial.println(pos1);
    delay(1000); 
  } 
   Serial.println("for 3");
  for(pos1 = 90; pos1>=50; pos1-=10) 
  {
    //servo1.write(pos1);
    Serial.println(pos1);
    servo2.write(pos1);
    delay(1000); 
  } 
   Serial.println("for 4");
  for(pos1 = 50; pos1<90; pos1+=10) 
  {
    //servo1.write(pos1);
    Serial.println(pos1);
    servo2.write(pos1);
    delay(1000); 
  } 
  
} 
